<?php
	require_once 'functions.php';
	
	function reshove($param){
		$openraise	    = mysql_real_escape_string($param[0]);
		$threebet 		= mysql_real_escape_string($param[1]);
		$stacksize 		= mysql_real_escape_string($param[2]);
		
		$reshove = array("","","","");
		$callreshove = array("","","","");
		$fourbetshove = array("","","","");
		
		if($openraise != ""){
			$reshove = query("SELECT * FROM reshove WHERE bb = '$stacksize' AND openraise = '$openraise'", true);
		}
		
		if($threebet != ""){
			$callreshove  = query("SELECT * FROM callreshove WHERE bb = '$stacksize' AND 3b = '$threebet'", true);
			$fourbetshove = query("SELECT * FROM 4betshove   WHERE bb = '$stacksize' AND 3b = '$threebet'", true);
		}

		print $reshove[3]."|".$callreshove[3]."|".$fourbetshove[3];
	}
	
	function shovecall($param){
		$openraise	    = mysql_real_escape_string($param[0]);
		$stacksize 		= mysql_real_escape_string($param[1]);
		
		$nashshove = array("","","");
		$chubukov = array("","","");
		$opencall = array("","","");
		$nashcall = array("","","");
		
		$nashshove = query("SELECT * FROM nashshove WHERE bb = '$stacksize'", true);
		$chubukov =  query("SELECT * FROM chubukov  WHERE bb = '$stacksize'", true);
		$opencall =  query("SELECT * FROM callopenshove  WHERE bb = '$stacksize' AND openraise = '$openraise'", true);
		$nashcall =  query("SELECT * FROM nashcall  WHERE bb = '$stacksize'", true);


		print $nashshove[2]."|".$chubukov[2]."|".$opencall[3]."|".$nashcall[2];
	}	
	
	if(isset($_GET['fn'])){
		$fn = $_GET['fn'];   
		
		if(isset($_GET['param'])){
			$paramArray = explode("|",$_GET['param']);
			$fn($paramArray);
		}else{
			$fn();
		}  
	} 
	

?>